<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>配置项列表</title>
	<Pintuer />
</head>
<body>
	<div class="container-layout">
		<div class="margin-top margin-bottom padding-left padding-top padding-bottom">
		<!-- tab标签 Box -->
		<div class="tab">
			<!-- tab标签 Start -->
			<div class="tab-head bg border">
				<ul class="tab-nav padding-top">
					<list from="$data" name="$vo">
						<li<if value="$vo.select eq 1">class="active"</if>>
						<a href="#{$vo.cname}" style="outline:none;">{$vo.ctitle}</a>
					</li>
					</list>
				</ul>
			</div>
			<!-- tab标签 End -->
			<!-- Tab标签 Content -->
			<div class="tab-content" >
				<form method="POST" id="form">
					<list from="$data" name="$c">
						<div class="tab-body" style="padding-top:1px;">
							<div class="tab-panel<if value='$c.select eq 1'>active</if>" id="{$c.cname}">
								<!-- table Start -->
								<table class="table table-bordered table-hover table-condensed">
									<tr>
										<td width="50">排序</td>
										<td width="150">标题</td>
										<td width="300">配置值</td>
										<td width="300">变量名</td>
										<td>描述</td>
										<td width="150">操作</td>
									</tr>
									<list from="$c._config" name="$vo">
										<tr>
											<td><input type="text" name="sort" value="{$vo.sort}" style="width:50px" /></td>
											<td>{$vo.title}</td>
											<td>{$vo._html}</td>
											<td>{$hd.config.{$vo.name}}</td>
											<td>{$vo.message}</td>
											<td>
												<if value="$vo.system eq 0">
													<a href="javascript:;" class="dialogs" data-toggle="click" data-target="#mydialog{$vo.id}" data-mask="1" data-width="20%">
														<span class="icon-times"></span>
														删除
													</a>
													<else />
													<span class="text-gray">
														<i class="icon-times"></i>
														删除
													</span>
												</if>
												<!-- 删除确认框 Start -->
												<div id="mydialog{$vo.id}">
													<div class="dialog radius-none bouncein">
														<div class="dialog-head">
															<span class="close icon-times"></span>
															<strong>删除确认对话框</strong>
														</div>
														<div class="dialog-body">
															<span class="icon-bitbucket"></span>
															确定删除该数据？
														</div>
														<div class="dialog-foot">
															<button class="button radius-none bg-sub" onClick="location.href='{|U:'del',array('id'=> $vo['id'])}'">
																<i class="icon-check-square-o"></i>
																确 认
															</button>
															<button class="button radius-none dialog-close">
																<i class="icon-times"></i>
																取 消
															</button>
														</div>
													</div>
												</div>
												<!-- 删除确认框 End -->
											</td>
										</tr>
									</list>
									<tr>
										<td class="text-center" colspan="7">
											<button type="button" id="editButton" class="button bg-sub radius-none">
												<i class="icon-check-square-o"></i>
												提交保存
											</button>
											<button type="button" id="delbutton" class="button radius-none" onClick="location.href='{|U:'add'}'">
												<i class="icon-edit"></i>
												添加配置
											</button>
										</td>
									</tr>
								</table>
								<!-- table End -->
							</div>
						</div>
					</list>
				</form>
				<script>
					$('#editButton').click(function(){
						$.post("{|U:'webConfig'}", $('#form').serialize(), function(data){
							if (data.status == true) {
								alert(data.message);
							} else {
								alert(data.message);
							}
						}, 'json')
						return false;
					});
				</script>
			</div>
			<!-- Tab标签 Content End -->
		</div>
		<!-- tab标签 Box End -->
	</div>
</div>
<!-- 标签页切换 -->
<script type="text/javascript">
$('.tab-content').find('.tab-body').hide();
$('.tab-content').find('.tab-body').eq(0).show();
$('.tab-nav').find('li').click(function(){
	var index = $(this).index();
	$('.tab-content').find('.tab-body').hide();
	$('.tab-content').find('.tab-body').eq(index).show();

})
</script>
</body>
</html>